package ch02;

public class Client {
    public static void main(String[] args) {
        OperationFactory additionFactory = new AdditionFactory();
        Operation addition = additionFactory.createOperation();
        int result1 = addition.calculate(5, 3);
        System.out.println("Result of addition: " + result1);

        OperationFactory subtractionFactory = new SubtractionFactory();
        Operation subtraction = subtractionFactory.createOperation();
        int result2 = subtraction.calculate(7, 2);
        System.out.println("Result of subtraction: " + result2);
    }
}
